#ifndef _TWOGRE_BOOL_VARIABLE_H_
#define _TWOGRE_BOOL_VARIABLE_H_

#include "TwOgrePrerequisites.h"
#include "TwOgreVariable.h"

#include "OgreString.h"

namespace TwOgre{

    class BoolParams
    {
    public:
        BoolParams(const Ogre::String& name)
            : parent_(0)
            , name_(name)
            , label_(Ogre::StringUtil::BLANK)
            , strTrue_(Ogre::StringUtil::BLANK)
            , strFalse_(Ogre::StringUtil::BLANK)
            , group_(Ogre::StringUtil::BLANK)
            , help_(Ogre::StringUtil::BLANK)
            , shortcut_(Ogre::StringUtil::BLANK)
            , type_(TW_TYPE_BOOLCPP)
            , readOnly_(false)
            , data_(NULL)
            , setCB_(NULL)
            , getCB_(NULL)
            , value_(false)
        {}
     
        BoolParams& label(const Ogre::String& varLabel)
        {
            label_ = varLabel;
            return *this;
        }
        BoolParams& displayStrings(const Ogre::String& varStrTrue, const Ogre::String& varStrFalse)
        {
            strFalse_ = varStrFalse;
            strTrue_ = varStrTrue;
            return *this;
        }
        BoolParams& group(const Ogre::String& varGroup)
        {
            group_ = varGroup;
            return *this;
        }
        BoolParams& help(const Ogre::String& varHelp)
        {
            help_ = varHelp;
            return *this;
        }
        BoolParams& shortcut(const Ogre::String& varShortcut)
        {
            shortcut_ = varShortcut;
            return *this;
        }
        BoolParams& readOnly(bool varReadOnly)
        {
            readOnly_ = varReadOnly;
            return *this;
        }
        BoolParams& callback(TwSetVarCallback setter, TwGetVarCallback getter, void* varData)
        {
            setCB_ = setter;
            getCB_ = getter;
            data_ = varData;
            return *this;
        }
        BoolParams& value(bool boolVal)
        {
            value_ = boolVal;
            return *this;
        }
    private:
		Window* parent_;
		Ogre::String name_;
        Ogre::String label_;
        Ogre::String strTrue_;
        Ogre::String strFalse_;
        Ogre::String group_;
        Ogre::String help_;
        Ogre::String shortcut_;
		TwType type_;
        bool readOnly_;
        void* data_;
        TwSetVarCallback setCB_;
        TwGetVarCallback getCB_;

        bool value_;
        
        friend class Window;
		friend class BoolVariable;		
    };
    
    class TwOgreExport BoolVariable : public Variable
	{
	protected:
		BoolVariable(Window *parent, const Ogre::String& name, bool readOnly, const Ogre::String& label, 
			bool value, const Ogre::String& groupName, const Ogre::String& help);
		BoolVariable(BoolParams& params);
		~BoolVariable();

	public:
		bool getBoolValue() const {return mValue;}
		void setBoolValue(bool value) {mValue = value;}

		void setDisplayStrings(const Ogre::String& trueString, const Ogre::String& falseString);
		void setShortcut(const Ogre::String& toggle);

	private:
		bool mValue;

		friend class Window;
	};
}; // End Namespace
#endif
